Third maximum number problem in C